import {cell, CellGroup, CellBlock, createStore, register, store} from 'components/form'
import {formData} from './contents/form'

export const tabsConfig = {
  $$id: "xxtab",
  tap(e, param, inst){
    const attr = inst.attr();
    const currentIndex = this.currentIndex
    if (currentIndex === 0) {
      if (attr.index !== currentIndex) {
        // save
        store.storeHelper.save()
      }
    } else {
      if (attr.index === 0) {
        // restore
        setTimeout(() => {
          store.storeHelper.restore()
        }, 100);
      }
    }
  },
  data: [
    // tabs
    [
      { title: "基本信息"},
      { title: "正文"},
      { title: "11"}
    ],

    // contents
    [
      <CellGroup key="aaa" data={formData} store={store} />,
      { title: "我是选项二内容啦啦啦！！！！！！" },
      { title: "33333" }
    ]
  ]
};